﻿using System;
using System.Collections.Generic;
using System.Data;
using Orchard.ContentManagement.Drivers;
using Orchard.ContentManagement.MetaData;
using Orchard.ContentManagement.MetaData.Builders;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration;

namespace Guang.UserGeolocation
{
    public class Migrations : DataMigrationImpl
    {
        public int Create()
        {            
            SchemaBuilder.CreateTable("UserCoordinateRecord", table => table
                .ContentPartRecord()                
                .Column("Latitude", DbType.Double)
                .Column("Longitude", DbType.Double)
            );

            ContentDefinitionManager.AlterPartDefinition("UserCoordinatePart",
              builder => builder.Attachable());
            return 1;
        }
    }
}

